﻿using System;
using System.Collections.Generic;
using System.Xml.Linq;

namespace umbraco.DataServices.Linq.Schema
{
    public interface ISchema {

        //Navigational Methods
        XElement GetParent(XElement element);
        IEnumerable<XElement> GetAncestors(XElement element);
        IEnumerable<XElement> GetAncestorsNamed(XElement element, IEnumerable<string> aliases);
        IEnumerable<XElement> GetChildren(XElement element);
        IEnumerable<XElement> GetChildrenNamed(XElement element, IEnumerable<string> aliases);
        IEnumerable<XElement> GetDescendants(XElement element);
        IEnumerable<XElement> GetDescendantsNamed(XElement element, IEnumerable<string> aliases);
        IEnumerable<XElement> GetSibblings(XElement element);
        IEnumerable<XElement> GetSibblingsNamed(XElement element, IEnumerable<string> aliases);

        //Property Methods
        IEnumerable<KeyValuePair<string,string>> GetProperties(XElement element);
        string GetProperty(XElement element, string alias);

        //Document Methods
        int GetId(XElement element);
        int GetParentId(XElement element);
        int GetLevel(XElement element);
        int GetWriterId(XElement element);
        int GetCreatorId(XElement element);
        int GetTemplateId(XElement element);
        int GetSortOrder(XElement element);
        DateTime GetCreateDate(XElement element);
        DateTime GetUpdateDate(XElement element);
        string GetTitle(XElement element);
        string GetUrlName(XElement element);
        int GetDocumentTypeId(XElement element);
        string GetDocumentType(XElement element);
        string GetWriterName(XElement element);
        string GetCreatorName(XElement element);
    }
}
